package com.fly;

import java.util.HashMap;


public class piecefactory {
	private HashMap piecepool=new HashMap();
	public piece Getpiece(String key){
		if(!piecepool.containsKey(key)){
			piece p=new onepiece(key);
			piecepool.put(key, p);
			return p;
			
		}
		return (piece) piecepool.get(key);
		
	}
	
	public int getpiececount(){
		return piecepool.size();
	}

}
